#include<bits/stdc++.h>

using namespace std;

inline bool even(int x) {
    return x % 2 == 0;
}

int main() {
    vector<int> v = {1, 2, 3, 4, 2};

    cout << (find(v.begin(), v.end(), 2) != v.end()) << endl;//线性查找
    cout << count(v.begin(), v.end(), 2) << endl;//统计2的个数
    cout << count_if(v.begin(), v.end(), even) << endl;//统计偶数个数
    cout << count_if(v.begin(), v.end(), [](int x) -> bool { return x & 1; }) << endl;//统计奇数个数
}